using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace JT808Protocol.Models.BodyParserStrategy
{
    public class DrInfoSubscription_0x0303 : IJT808Body
    {
        /// <summary>
        /// 信息类型
        /// </summary>
        [JsonPropertyName("信息类型")] public byte InfoType { get; set; }

        /// <summary>
        /// 信息标志
        /// </summary>
        [JsonPropertyName("信息标志")] public byte InfoFlag { get; set; }

        /// <summary>
        /// 下发命令缓存数组
        /// </summary>
        [JsonPropertyName("下发命令缓存数组")] public byte[] dataBuffer { get; set; }

        public override IJT808Body ReadBody(ReadOnlySpan<byte> source, ref int startIndex)
        {
            InfoType = source[startIndex];
            InfoFlag = source[startIndex + 1];
            return this;
        }

        public override List<byte> WriteToBytes()
        {
            throw new NotImplementedException();
        }
    }
}